<%--
  Created by IntelliJ IDEA.
  User: 老大哥
  Date: 2022/6/11
  Time: 21:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String basePath = request.getScheme() + "://" +
            request.getServerName() + ":" +request.getServerPort() +
            request.getContextPath() + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap.min.css">
    <script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
    <title>客户登记</title>
</head>
<body>


<!-- 添加宠物模态框（Modal） -->
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="myModalLabel">宠物登记</h4>
            </div>
            <div class="modal-body">
                <%--模态框表单--%>
                <form class="layui-form" action="${pageContext.request.contextPath}/addCustomer" id="form" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">客户姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" required  lay-verify="required" placeholder="请输入客户的姓名" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">客户性别</label>
                        <div class="layui-input-block">
                            <select name="customerGender" lay-verify="required">
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">客户电话</label>
                        <div class="layui-input-block">
                            <input type="text" name="phone" required  lay-verify="required" placeholder="请输入客户的手机号" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">客户地址</label>
                        <div class="layui-input-block">
                            <input type="text" name="address" required  lay-verify="required" placeholder="请输入客户的居住地址" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">宠物名</label>
                        <div class="layui-input-block">
                            <input type="text" name="petName" required  lay-verify="required" placeholder="请输入客户的宠物名" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">宠物性别</label>
                        <div class="layui-input-block">
                            <select name="petGender" lay-verify="required">
                                <option value="公">公</option>
                                <option value="母">母</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">病情描述</label>
                        <div class="layui-input-block">
                        <textarea
                                cols="43"
                                rows="13"
                                name="illness"
                                form="form">
                         </textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="submit" class="layui-btn layui-btn-primary">提交登记</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
                <script>
                    //Demo
                    layui.use('form', function(){
                        var form = layui.form;

                        //监听提交
                        form.on('submit(formDemo)', function(data){
                            layer.msg(JSON.stringify(data.field));
                            return false;
                        });
                    });
                </script>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>
<script>
    $(function () {
        Visit();
    })
    // 添加兽医弹出框, 显示弹框,传递对应的newsId
    function Visit(){
        //赋值id,方便传递到后台
        $('#addModal').modal('show');
    }
</script>
</html>
